Campina::Application.routes.draw do

  resources :posts

  resources :topics

  resources :forums
  #get "historia/index"  
  #match 'forums', :controller => 'forums'

  root :to => 'catalog#index'
  match 'catalog' => 'catalog#index'  
  match 'about' => 'about#index'
  match 'checkout' => 'checkout#index'
  match 'admin/producto' => 'admin/producto#index'
  match 'admin/productor' => 'admin/productor#index'
  match 'admin/order' => 'admin/order#index'
  match 'admin/forums' => 'admin/forums#index'
  match 'admin/forum/show/:id' => 'admin/forum#show'
  match 'historia' => 'historia#index'
  
  get 'admin/producto/new'
  post 'admin/producto/create'
  get 'admin/producto/edit'
  post 'admin/producto/update'
  post 'admin/producto/destroy'
  get 'admin/producto/show'
  match 'admin/producto/show/:id' => 'admin/producto#show'
  get 'admin/producto/index'

  get 'admin/productor/new'
  post 'admin/productor/create'
  get 'admin/productor/edit'
  post 'admin/productor/update'
  post 'admin/productor/destroy'
  get 'admin/productor/show'
  match 'admin/productor/show/:id' => 'admin/productor#show'
  get 'admin/productor/index'
  
  post 'admin/order/close'
  get 'admin/order/show'
  match 'admin/order/show/:id' => 'admin/order#show'
  get 'admin/order/index'

  get'catalog/rss'
  get 'catalog/show'
  match 'catalog/show/:id' => 'catalog#show'
  get 'catalog/index'
  get 'catalog/latest'
  
  get 'cart/add'
  post 'cart/add'
  get 'cart/remove'
  post 'cart/remove'
  get 'cart/clear'
  post 'cart/clear'

  get 'user_session/new'
  post 'user_session/create'
  get 'user_session/destroy'
  get 'user_session/olvido'

  get 'user/new'
  post 'user/create'
  get 'user/show'
  match 'user/show/:id' => 'user#show'
  get 'user/edit'
  post 'user/update'

  get 'checkout/index'
  post 'checkout/submit_order'
  get 'checkout/thank_you'
  
  
  get 'password_reset_instructions/new'
  post 'password_reset_instructions/create'
  get 'password_reset_instructions/edit'
  #post 'password_reset_instructions.:id' => 'admin/producto#index'
  match 'password_reset_instructions/edit' => 'password_reset_instructions#edit'
  
  put 'password_reset_instructions/' => "password_reset_instructions#update", as: 'password_reset_instructions'
  
  
  #match 'password_reset_instructions.:id' => 'admin/producto#index'
  

  # The priority is based upon order of creation:
  # first created -> highest priority.

  # Sample of regular route:
  #   match 'products/:id' => 'catalog#view'
  # Keep in mind you can assign values other than :controller and :action

  # Sample of named route:
  #   match 'products/:id/purchase' => 'catalog#purchase', :as => :purchase
  # This route can be invoked with purchase_url(:id => product.id)

  # Sample resource route (maps HTTP verbs to controller actions automatically):
  #   resources :products

  # Sample resource route with options:
  #   resources :products do
  #     member do
  #       get 'short'
  #       post 'toggle'
  #     end
  #
  #     collection do
  #       get 'sold'
  #     end
  #   end

  # Sample resource route with sub-resources:
  #   resources :products do
  #     resources :comments, :sales
  #     resource :seller
  #   end

  # Sample resource route with more complex sub-resources
  #   resources :products do
  #     resources :comments
  #     resources :sales do
  #       get 'recent', :on => :collection
  #     end
  #   end

  # Sample resource route within a namespace:
  #   namespace :admin do
  #     # Directs /admin/products/* to Admin::ProductsController
  #     # (app/controllers/admin/products_controller.rb)
  #     resources :products
  #   end

  # You can have the root of your site routed with "root"
  # just remember to delete public/index.html.
  # root :to => 'welcome#index'

  # See how all your routes lay out with "rake routes"

  # This is a legacy wild controller route that's not recommended for RESTful applications.
  # Note: This route will make all actions in every controller accessible via GET requests.
  # match ':controller(/:action(/:id))(.:format)'
end
